package cn.com.haopy.dataes.db.datasource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class DataSourceContextHolder {
    private final Log logger = LogFactory.getLog(DataSourceContextHolder.class);

    private static final ThreadLocal contextHolder = new ThreadLocal();

    public static void setDbType(DBTypeEnum dbType) {
        contextHolder.set(dbType.getValue());
    }

    public static String getDbType() {
        return (String) contextHolder.get();
    }

    public static void clearDbType() {
        contextHolder.remove();
    }
}
